package com.gaofei.hr.controller;

import com.gaofei.hr.domain.Hr;
import com.gaofei.hr.interfaces.HrControllerFeign;
import com.gaofei.hr.tasks.OrderTask;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author : gaofee
 * @date : 16:32 2021/6/2
 * @码云地址 : https://gitee.com/itgaofee
 */

@RestController
public class HrController  {

    @Autowired
    OrderTask orderTask;

    @RequestMapping("list")
    public String list(){
        Hr hr = new Hr();
        hr.setId(1L);
        hr.setName("hr");
        return "访问hr成功!!!";
    }

    @RequestMapping("testTask")
    public String testTask(){
        //1.用户开始下单
//        service.addOrder(order)
        //2.立马开启定时任务:30分钟后,检查订单是否支付,如果未支付,把订单状态改为已关闭
        orderTask.startTask();
        return "访问hr成功!!!";
    }
}
